<?php

defined('_JEXEC') or die('Restricted access');
?>

<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
	
	var form = document.adminForm;
	
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}

	// do field validation
	if (form.from.value == ""){
		alert( "Please add From location" );
                return false;
	} else if (form.to.value == ""){
		alert( "Please add To location" );
                return false;
	} else {
		submitform( pressbutton );
	}
}
</script>


<form action="index.php" method="post" name="adminForm" id="adminForm">

	<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
                                        <tr>
						<td>
							<label for="title">
								<?php echo JText::_( 'FROM' ).':'; ?>
							</label>
						</td>
						<td>
                                                    <input type="text" name="from" value="<?php echo $this->row->from; ?>" size="50" maxlength="255" />
						</td>
						<td>
							<label for="published">
								<?php echo JText::_( 'TO' ).':'; ?>
							</label>
						</td>
						<td>
                                                    <input type="text" name="to" value="<?php echo $this->row->to; ?>" size="50" maxlength="255" />
						</td>
					</tr>
                                        <tr>
						<td>
							<label for="title">
								<?php echo JText::_( 'ROUTE_PRICE' ).':'; ?>
							</label>
						</td>
						<td>
							<input type="text" name="price" value="<?php echo $this->row->price; ?>" size="50" maxlength="100" />
						</td>
                                                
                                                
						<td>
							<label for="published">
								<?php echo JText::_( 'PUBLISHED' ).':'; ?>
							</label>
						</td>
						<td>
							<?php
							$html = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $this->row->published );
							echo $html;
							?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>

<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="option" value="com_taxibooking" />
<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
<input type="hidden" name="controller" value="routes" />
<input type="hidden" name="view" value="route" />
<input type="hidden" name="task" value="" />
</form>

<?php
//keep session alive while editing
JHTML::_('behavior.keepalive');
?>